<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<c:set var="ctx" value="${pageContext.request.contextPath}" />
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>PDA扫描出库</title>
<script src="${ctx}/resources/js/jquery-1.9.1.min.js" type="text/javascript"></script>
<style type="text/css">
body {
	font-size: 14px;
	line-height: 20px;
}

.orderInfo {
	color: blue;
}

.numLeft {
	font-weight: bold;
	color: red;
	font-size: 14px;
}
</style>
</head>
<body>
	<c:if test="${fn:length(orderList) > 0 }">
		<div class="bar">
			<form id="dataForm" action="${ctx }/wap/pda/pdaOut" method="post">
				<table width="100%">
					<thead>
						<tr>
							<td style="color: blue;">
								<b>出库管理</b>
								<a href="${ctx}/wap/pda.jsp">返回</a>
								<hr />
							</td>
						</tr>
					</thead>
					<tr>
						<td colspan="3" style="color: blue;">${msg }</td>
					</tr>
					<tr>
						<td colspan="3">
							出库单：
							<select id="order" name="orderId" style="width: 100%;">
								<c:forEach items="${orderList }" var="orderh" varStatus="i">
									<option value="${orderh.id }" <c:if test="${order.id == orderh.id }">selected</c:if>>${i.index + 1 }.${orderh.code }</option>
								</c:forEach>
							</select>
						</td>
					</tr>
					<tr>
						<td colspan="3">
							二维码：
							<input style="width: 100%;" name="qrCode" id="qrCode" type="text" />
							<input type="button" id="clearQr" value="清除">
							<input type="submit" value="提交">
						</td>
					</tr>
					<tr>
						<td colspan="3" class="orderInfo"></td>
					</tr>
				</table>
			</form>
			<input type="button" id="clearAll" value="清空并重新录入">
		</div>
		<script type="text/javascript">
			$(function() {
				$("#order").change(function() {
					var orderId = $(this).val();
					$(".orderInfo").load("${ctx}/adoms/orderLine/listInfo/" + orderId);
				}).change();
				$("#clearQr").click(function() {
					$("#qrCode").val("");
				});
				$("#clearAll").click(function() {
					$("#dataForm").attr("action", "${ctx }/wap/pda/clearOutData");
					$("#dataForm").submit();
				});
				$("#qrCode").focus();
			});
		</script>
	</c:if>
	<c:if test="${fn:length(orderList) < 1 }">
	暂无出库单，<a href="${ctx}/wap/pda.jsp">返回</a>！
	</c:if>
</body>
</html>